/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.cgb.portal.entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;

/**
 *
 * @author LUCAS
 */
@Entity(name = "\"ACTIVATION_CODE\"")
@SequenceGenerator(name = "ACTIV_CODE_GEN", sequenceName = "ACTIV_CODE_GEN",
allocationSize = 1, initialValue = 1)
public class ActivationCode implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ACTIV_CODE_GEN")
    private Long id;
    private String code;
    @ManyToOne
    @JoinColumn(name = "user_id")
    private User user;

    public ActivationCode() {
    }

    public ActivationCode(String code, User user) {
        this.code = code;
        this.user = user;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
